Skip to content

Instantly share code, notes, and snippets.

Flet Code Highlighting

image

import flet as ft
import re
from dataclasses import dataclass
@nngogol
nngogol / pdf_russian_reportlab.py
Created March 21, 2018 14:08
How to write russian text in reportlab in python. Also, download 'DejaVuSerif.ttf' from internet.
#!/usr/bin/env python
#-*- coding: UTF-8 -*-
from reportlab.lib import colors
from reportlab.platypus import Paragraph, SimpleDocTemplate, Table, TableStyle
from reportlab.lib.styles import getSampleStyleSheet
from reportlab.lib.pagesizes import A4
from reportlab.pdfbase import pdfmetrics
from reportlab.pdfbase.ttfonts import TTFont
@SH20RAJ
SH20RAJ / videos.json
Created May 17, 2024 18:58
Sample Videos for Testing
{
"name": "Movies",
"videos": [
{
"description": "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org",
"sources": [
"http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4"
],
"subtitle": "By Blender Foundation",
@HoussemNasri
HoussemNasri / BalsamiqForever.py
Last active May 17, 2024 18:57
Extend your trial period for Balsamiq Wireframes on Windows and macOS Forever!
import json
import os
import time
import webbrowser
import sys
import re
def handleWindows(extra_seconds):
print("OS : Windows")
@Wirone
Wirone / imagick-3.7.0-failed-install-on-docker-PHP-8.3-build.txt
Last active May 17, 2024 18:54
Imagick 3.7.0 failed installation on PHP 8.3.2
Built on Docker with php:8.3.2-fpm-bullseye as a base image
Prerequisites installed: libmagickwand-dev, libmagickwand-6.q16-6
FYI: Same dependencies work properly on PHP 8.2.10
-----
326.0 downloading imagick-3.7.0.tgz ...
326.0 Starting to download imagick-3.7.0.tgz (360,138 bytes)
326.0 .........................................................................done: 360,138 bytes
@rumansaleem
rumansaleem / clean-up-arch-linux.md
Created May 28, 2019 08:51
Instructions to clean up Arch Linux (Manjaro)

Contents

  • Clean pkg cache
  • Remove unused packages (orphans)
  • Clean cache in /home
  • remove old config files
  • Find and Remove
    • duplicates
    • empty files
    • empty directories
  • broken symlinks
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active May 17, 2024 18:52
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@Peej11
Peej11 / sc_on_deck.md
Last active May 17, 2024 18:48
Star Citizen 3.18.1 on the Steam Deck

This is a set of instructions specific to the Steam Deck that is curated and combined from several guides and help I've found on the LUG Discord as well as /r/StarCitizen. This will help you configure your system, download and extract the utilities needed, and do a (mostly) standard install. We're not using Lutris and instead doing a manual install since the LUG installer doesn't work well with the Flatpak without additional configuration. Hopefully it is helpful.

Tested on the 512GB SKU

Prep your Steam Deck

Enable SSH (optional)

Enable SSH if you'd like to do things remotely. This is helpful if you don't have a mouse and keyboard.

  1. Switch to desktop mode
  2. Open Konsole
  3. Set a password with passwd
@billchurch
billchurch / sonos_unifi_discovery.py
Last active May 17, 2024 18:48
Python script to find all sonos units on your network with uPNP and then connect to a unifi switch to tell you what switch port they're on
import socket
import requests
import paramiko
import time
import xml.etree.ElementTree as ET
def discover_sonos_devices():
MCAST_GRP = '239.255.255.250'
MCAST_PORT = 1900
msg = (